<?php
class Home extends CI_Controller{
	
	public function index(){
		$this->template->write_view('content','home/index',null,TRUE);
		$this->template->load();
	}

	public function test(){
		$datetime = new DateTime(); 
		/*
		$tz = "Asia/Jakarta";
		$tz_object = new DateTimeZone($tz); 
		$datetime->setTimezone($tz_object);
		*/
		//echo $datetime->format('Y-m-d H:m:s');
		/*
		$date = date('YmdHis',time());
		echo $date;
		if (!isset($_SERVER['PHP_AUTH_USER'])) {
			header('WWW-Authenticate: Basic realm="My Realm"');
			header('HTTP/1.0 401 Unauthorized');
			echo 'Text to send if user hits Cancel button';
			exit;
		} else {
			echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
			echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
		}
		*/
		$_COOKIE['test'] = 'xuan dung';
		//setcookie('test','aaa',time()*24*60*60);
		echo $_COOKIE['test'];		
		
	} 
	
	
}
